const JSEncrypt = require('node-jsencrypt');
const {readFileSync} = require("fs");
const {join} = require("path");

const privateKey = readFileSync(join(__dirname, '../../keys/rsa_private_key.pem')).toString('ascii');
const decrypt = new JSEncrypt();
decrypt.setPrivateKey(privateKey);

module.exports = (encrypted) => {
    return decrypt.decrypt(encrypted)
}